package service.impl;

import java.util.List;

import dao.MenuDao;
import dao.impl.MenuDaoImpl;
import entiey.Menu;
import entiey.TypeId;
import service.MenuService;

public class MenuServiceImpl implements MenuService{
	private MenuDao md=new MenuDaoImpl();
	@Override
	public boolean add(Menu menu) {
		return md.add(menu)>0;
	}

	@Override
	public boolean delete(int id) {
		return md.delete(id)>0;
	}

	@Override
	public boolean update(Menu menu) {
		return md.update(menu)>0;
	}

	@Override
	public List<Menu> findAll() {
		return md.findAll();
	}

	@Override
	public Menu findById(int id) {
		return md.findById(id);
	}

	@Override
	public Menu findByNameAndPrice(String name, double price) {
		return md.findByNameAndPrice(name, price).get(0);
	}

	@Override
	public List<Menu> likeFind(String text) {
		return md.likeFind(text);
	}

	@Override
	public List<Menu> findByType(int id) {
		return md.findByType(id);
	}
	@Override
	public boolean updateComId(Menu menu,int cid) {
		return md.updateComId(menu, cid)>0;
	}

	@Override
	public boolean updateComId(int cid, int mid) {
		return md.updateComId(cid, mid)>0;
	}

	@Override
	public List<Menu> selectMenu(int cid) {
		return md.selectMenu(cid);
	}

	@Override
	public List<Menu> findByComId(int cid) {
		return md.findByComId(cid);
	}
	
}
